package com.example.springioc.controller;

import com.example.springioc.model.DBType;
import com.example.springioc.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * ClassName: YmlController
 * Package: IntelliJ IDEA
 * Description:
 *
 * @Author 谷京京
 * @Create 2023/11/6 20:06
 * @Version 1.0
 */

@RestController
public class YmlController {
    @Autowired
    public Student student;

    @Autowired
    public DBType dbType;
    @Value("${demo.key1}")
    private String key1;

    @Value("${demo.key2}")
    private String key2;

    @Value("${string.str1}")
    private String str1;

    @Value("${string.str2}")
    private String str2;

    @Value("${string.str3}")
    private String str3;



    @RequestMapping("/readKey1")
    public String readKey1() {
        return key1;
    }

    @PostConstruct
    public void init() {
//        System.out.println("key1:" + key1 + " key2: " + key2);
//        System.out.println("str1: " + str1);
//        System.out.println("str2: " + str2);
//        System.out.println("str3: " + str3);
//        System.out.println(student);
//        System.out.println(dbType);
    }
}
